Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper Transaction type for eth_* calls when running Optimism #8157

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

emlautarom1
Copy link
Contributor

Changes

  • Properly map Transaction type instead of always using 0x7E ("deposit")

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Description

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Notes on testing

Added unit tests to ensure that we're not changing TxType and we're including additional receipt information for "deposit" transactions only.

Documentation

Requires documentation update

  • Yes
  • No

Requires explanation in Release Notes

  • Yes
  • No

Remarks

I'm curious as to why we didn't get this reported earlier considering that the issue has been present since #7483.

{
OptimismTxReceipt? receipt = _receiptFinder
.Get(block)
.Cast<OptimismTxReceipt>()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are all receipts always of type OptimismTxReceipt or is it possible to have a TxReceipt? If the later is correct then this cast will fail at runtime.

cc. @flcl42 @jmederosalvarado

Copy link
Member

@LukaszRozmej LukaszRozmej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potentially you could make EthRpcModule bit more extensible and avoid some code duplication.

@emlautarom1
Copy link
Contributor Author

Potentially you could make EthRpcModule bit more extensible and avoid some code duplication.

I've removed the duplication in the eth_getTransactionByBlock[Hash|Number]AndIndex by merging both into a single method, thus requiring a single override rather than two.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants